﻿using Common;
using DalFactory;
using IBLL;
using IDal;
using Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BLL
{
    public class SysUserService : BaseService<Sys_User>, ISysUserService
    {
        private readonly ISysUserDal SysUserDAL = Container.Resolve<ISysUserDal>();

        public override void SetCurrentDal()
        {
            CurrentDal = SysUserDAL;
        }

        public Task<Sys_User> GetModelAsync(string name, string pwd)
        {
            string hashPassword = StringHelper.Md5(pwd);
            return SysUserDAL.GetModelAsync(p => p.Account == name && p.Password == hashPassword);
        }
    }
}
